package com.cyyang.shop.service.impl;

import java.util.List;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.cyyang.shop.bean.Brand;
import com.cyyang.shop.mapper.BrandMapper;
import com.cyyang.shop.service.BrandService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service(timeout = 10000)
public class BrandServiceImpl implements BrandService{

	@Autowired
	BrandMapper brandMapper;

	@Override
	public PageInfo<Brand> findBrand(Integer pageNum, Integer pageSize,Brand brand) {
		PageHelper.startPage(pageNum, pageSize);
		List<Brand> list = brandMapper.findBrand(brand);
		for (Brand brand2 : list) {
			System.out.println(brand2);
		}
		PageInfo<Brand> info = new PageInfo<Brand>(list);
		return info;
	}

	@Override
	public void addBrand(Brand brand) {
		brandMapper.addBrand(brand);
	}

	
	
	
	
	

}
